QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

External Reference Objects

Labels

ASCII
ExternalReference
Binary
rfex ( = 0x72666578 )

Data Format

Uns32               refID
refID
A positive integer. The ExternalReference object with this refID is linked to a file pointer in the external file by means of a table of contents entry in the external file that contains both the refID and the file pointer. (The external file itself is specified by means of a subobject; see below.)

Data Size

4

Description

An external reference object is used to permit an object defined in another file to be referenced at one or more locations in a metafile.

Version 1.0 of this document described a design for external references that was not implemented in QD3D 1.0. In implementing external references in QD3D 1.5 we have decided on a somewhat different design. Its main advantage is that it allows the table of contents to contain the ExternalReference type, which means that tables of contents can be searched for all external references.

Suppose that in metafile F2 you want to reference an object ObjR that's contained in some other metafile F1. For this to be possible, F1 must have an entry to object ObjR in its table of contents. In metafile F2, a reference to ObjR is made by an external reference object. Its syntax is:

    Container (
        ExternalReference ( 2 )
        CString ( "ExtRefTransform.TXT"
        )
    )

In this example, 2 is the reference ID, which is the number used by the TOC to find the object in F1. The string "ExtRefTransform.TXT" is the name of file F1 enclosed in quotation marks.

There are two conditions that must be met by the TOC of any metafile that contains ExternalReference objects:

These are needed so that the QD3D call Q3File_GetExternalReferences works properly. This call looks at the objectTypes in the TOC to determine whether ExternalReference objects are present.

Parent Hierarchy

Shared.

Parent Objects

An ExternalReference object sometimes but not always has a parent object.

Child Objects

C string that gives the pathname of the file that contains the object to be externally referenced, as described above.

ExampleS

3DMetafile ( 1 5 Normal tableofcontents4> )
    lambertillumination6:
    LambertIllumination ( )
    translate7:
    Container (
        ExternalReference ( 1 )
        cstring8:
        CString (
            "ExtRefTransformAA.TXT"
        )
    )
    box9:
    Container (
        ExternalReference ( 2 )
        cstring10:
        CString (
            "ExtRefTransformAA.TXT"
        )
    )
    Reference ( 1 )
    tableofcontents4:
    TableOfContents (
        tableofcontents5>                   # next TOC
        3                                   # reference seed
        -1                                  # typeSeed
        1                                   # tocEntryType
        16                                  # tocEntrySize
        2                                   # nEntries
        1 translate7>
        ExternalReference
        2 box9>
        ExternalReference
    )
 

Offset

Hexadecimal code

ASCII

0000

3344 4D46 2020 2010 2001 2005 2020 2020

3DMF············

0010

2020 2020 2020 2094 6C6D 696C 2020 2020

········lmil····

0020

636E 7472 2020 202C 7266 6578 2020 2004

cntr···,rfex····

0030

2020 2001 7374 7263 2020 2018 4578 7452

····strc····ExtR

0040

6566 5472 616E 7366 6F72 6D41 412E 4249

efTransformAA.BI

0050

4E20 2020 636E 7472 2020 202C 7266 6578

N···cntr···,rfex

0060

2020 2004 2020 2002 7374 7263 2020 2018

········strc····

0070

4578 7452 6566 5472 616E 7366 6F72 6D41

ExtRefTransformA

0080

412E 4249 4E20 2020 7266 726E 2020 2004

A.BIN···rfrn····

0090

2020 2001 746F 6320 2020 203C 2020 2020

····toc····<····

00A0

2020 2020 2020 2003 FFFF FFFF 2020 2001

················

00B0

2020 2010 2020 2002 2020 2001 2020 2020

················

00C0

2020 2020 7266 6578 2020 2002 2020 2020

····rfex········

00D0

2020 2054 7266 6578

···Trfex

3DMetafile ( 1 5 Database
        tableofcontents0> )
    translate2:
    Translate ( -40 30 20 )
    box3:
    Box (
        25 0 0                              # orientation
        0 10 0                              # majorAxis
        0 0 20                              # minorAxis
        -30 -5 -10 # origin
    )
    tableofcontents0:
    TableOfContents (
        tableofcontents1>                   # next TOC
        3                                   # reference seed
        -1                                  # typeSeed
        1                                   # tocEntryType
        16                                  # tocEntrySize
        2                                   # nEntries
        1 translate2>
        Translate
        2 box3>
        Box
    )

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |